import request from '@/utils/request'

export function getHotPlants(){
    return request({
        url: '/plant/hotPlants',
        method: 'get',
        headers: {
            isToken: false
        },

    })
}
export function getPlantById(plantId){
    return request({
        url: '/plant/getPlantById/'+plantId,
        method: 'get',
        headers: {
            isToken: false
        },
    })
}

export function getPlants(params){
    return request({
        url: '/plant/getPlants',
        method: 'get',
        headers: {
            isToken: false
        },
        params:params
    })
}
export function updateLikeCount(plantId){
    return request({
        url: '/plant/updatelikeCount/'+plantId,
        method: 'put',
        headers: {
            isToken: false
        },
    })

}

export function addPlant(param){
    return request({
        url: '/plant/addPlant',
        method: 'post',
        headers: {
            isToken: false
        },
        data:param
    })
}

export function getMyPlant(id){
    return request({
        url: '/plant/'+id,
        method: 'get',
        headers: {
            isToken: false
        },

    })
}
export function deleteMyPlant(plant){
    return request({
        url: '/plant/delete/'+plant.plantId,
        method: 'delete',
        headers: {
            isToken: false
        },


    })
}
export function updateMyPlant(plant){
    return request({
        url: '/plant/update/'+plant.plantId,
        method: 'put',
        headers: {
            isToken: false
        },
        data:plant

    })
}